#ifndef CHARACTER_H
#define CHARACTER_H

#include <string>
#include <iostream>
#include "IObservable.h"
#include <list>

using namespace std;

class Character : public IObservable
{
public: 
	Character();
	Character(int _strengthValue, int _strengthCounters, int _craftCounters, int _craftValue, int _lifeCounters, int _lifeValue, int _fateTokens, int _fateValue, int _gold);

	void dataChange(int str, int cr, int fa, int li, int go);
	void registerOb(Observer* ob);
    void removeOb(Observer* ob);
    void notify();
	//***************** STRENGTH *****************

	//Losing Strength: remove Strength Counter, A Character's Strength may never drop below the Character's Strength Value
	void loseStrength();

	//Gaining Strength Counters during play
	void gainStrength(int);
	//Strength at any given time is Strength Value + Strength Counters + Strength from Objects, Magic Objects and Followers 
	//that may be used at that time
	int getStrength();

	//***************** CRAFT *****************
	void loseCraft();
	void gainCraft(int);
	int getCraft();

	//***************** LIVES *****************

	void loseLife();
	void gainLife(int);
	void heal();
	int getLives();
	void killCharacter();


	//***************** TOKENS *****************

	//Pay a Fate Token to reroll, if no Fate Tokens left, indicate that a reroll will not be permitted;
	bool payToken();
	void replenishFate();
	void gainFate(int);
	int getFate();

	//***************** GOLD *****************

	void loseGold(int);
	void gainGold(int);
	int getGold();


	//***************** BATTLE *****************
	int attackRoll();

	//***************** GAMEPLAY *****************
	int moveRoll();
	virtual void announce();

private:
	int strengthValue;
	int strengthCounters;
	int craftCounters;
	int craftValue;
	int lifeCounters;
	int lifeValue;
	int fateTokens;
	int fateValue;
	int gold;
	list<Observer*> observers;

	bool isDead;
};

#endif //CHARACTER_H